]> git.neil.brown.name Git - wiggle.git/commitdiff
Re-indent code messed up by name-change.
authorNeilBrown <neil@brown.name>
Sat, 3 Oct 2020 10:34:54 +0000 (20:34 +1000)
committerNeilBrown <neil@brown.name>
Sat, 3 Oct 2020 10:34:54 +0000 (20:34 +1000)
Previous patch made some names longer which messed up some
indenting alignment.  So re-indent things to look better.

Signed-off-by: NeilBrown <neil@brown.name>
bestmatch.c
diff.c
extract.c
merge2.c
vpatch.c
wiggle.c
wiggle.h

index 6d1bcbd93242f00c7854cfdc64a7dfc1be8b1864..df872d45f3b90c08cd55f6bd12fd97360b750547 100644 (file)
@@ -245,8 +245,8 @@ static void find_best(struct file *a, struct file *b,
                       (y > bhi ||
                        (best_val(&v[klo], min(ahi-x, bhi-y)) < best[v[klo].c].val &&
                         best_val(&v[klo+1], min(ahi-x, bhi-y+1)) < best[v[klo+1].c].val
-                               )
-                              )) {
+                       )
+               )) {
                        klo += 2;
                        x = (klo+f)/2; y = x-klo;
                }
@@ -260,8 +260,8 @@ static void find_best(struct file *a, struct file *b,
                        (v[khi].c >= 0 &&
                         best_val(&v[khi], min(ahi-x, bhi-y)) < best[v[khi].c].val &&
                         best_val(&v[khi-1], min(ahi-x+1, bhi-y)) < best[v[khi].c].val
-                               )
-                              )) {
+                       )
+               )) {
                        khi -= 2;
                        x = (khi+f)/2; y = x - khi;
                }
@@ -478,8 +478,8 @@ struct csl *wiggle_pdiff(struct file a, struct file b, int chunks)
                                while (xlo > xmin && !ends_line(a.list[xlo-1]))
                                        xlo--;
                                csl2 = wiggle_diff_partial(a, b,
-                                                   xlo, best[i].xlo,
-                                                   ylo, best[i].ylo);
+                                                          xlo, best[i].xlo,
+                                                          ylo, best[i].ylo);
                                csl1 = wiggle_csl_join(csl1, csl2);
                        }
 
@@ -487,8 +487,8 @@ struct csl *wiggle_pdiff(struct file a, struct file b, int chunks)
                         * good match
                         */
                        csl2 = wiggle_diff_partial(a, b,
-                                           best[i].xlo, best[i].xhi,
-                                           best[i].ylo, best[i].yhi);
+                                                  best[i].xlo, best[i].xhi,
+                                                  best[i].ylo, best[i].yhi);
                        csl1 = wiggle_csl_join(csl1, csl2);
 
                        /* Now if there are newlines at the end of the
@@ -512,8 +512,8 @@ struct csl *wiggle_pdiff(struct file a, struct file b, int chunks)
                                        xhi++;
                                }
                                csl2 = wiggle_diff_partial(a, b,
-                                                   best[i].xhi, xhi,
-                                                   best[i].yhi, yhi);
+                                                          best[i].xhi, xhi,
+                                                          best[i].yhi, yhi);
                                csl1 = wiggle_csl_join(csl1, csl2);
                                xmin = xhi;
                        }
diff --git a/diff.c b/diff.c
index 2772b21e98145c953f515e8c149b542efaeb1821..951dd9f7b71dd6e1cd48378de9c3f4b1451aeb1c 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -686,7 +686,7 @@ struct csl *wiggle_diff(struct file a, struct file b, int shortest)
  * subranges of files.
  */
 struct csl *wiggle_diff_partial(struct file a, struct file b,
-                        int alo, int ahi, int blo, int bhi)
+                               int alo, int ahi, int blo, int bhi)
 {
        struct v *v;
        struct cslb cslb = {};
index feaafd42155b02e1ea4d653e45fdce4b290e3dae..9a60fc9205dfa0e595405c15ec5f966153e8f62d 100644 (file)
--- a/extract.c
+++ b/extract.c
@@ -225,7 +225,8 @@ int wiggle_split_patch(struct stream f, struct stream *f1, struct stream *f2)
 /*
  * extract parts of a "diff3 -m" or "wiggle -m" output
  */
-int wiggle_split_merge(struct stream f, struct stream *f1, struct stream *f2, struct stream *f3)
+int wiggle_split_merge(struct stream f, struct stream *f1, struct stream *f2,
+                      struct stream *f3)
 {
        int state = 0;
        char *cp, *end;
index 98b04b697495b0dfc8f6f2af0217f599145b73c4..448d73cc3dc86c497e925b7ec6340cbdbbcb2abc 100644 (file)
--- a/merge2.c
+++ b/merge2.c
@@ -90,9 +90,9 @@ static int is_cutpoint(struct merge m,
 }
 
 int wiggle_isolate_conflicts(struct file af, struct file bf, struct file cf,
-                     struct csl *csl1, struct csl *csl2, int words,
-                     struct merge *m, int show_wiggles,
-                     int *wigglesp)
+                            struct csl *csl1, struct csl *csl2, int words,
+                            struct merge *m, int show_wiggles,
+                            int *wigglesp)
 {
        /* A Conflict indicates that something is definitely wrong
         * and so we need to be a bit suspicious of nearby apparent matches.
@@ -427,8 +427,8 @@ int wiggle_isolate_conflicts(struct file af, struct file bf, struct file cf,
 }
 
 struct ci wiggle_make_merger(struct file af, struct file bf, struct file cf,
-                     struct csl *csl1, struct csl *csl2, int words,
-                     int ignore_already, int show_wiggles)
+                            struct csl *csl1, struct csl *csl2, int words,
+                            int ignore_already, int show_wiggles)
 {
        /* find the wiggles and conflicts between csl1 and csl2
         */
@@ -613,7 +613,7 @@ struct ci wiggle_make_merger(struct file af, struct file bf, struct file cf,
                        rv.merger[i].type = Conflict;
        }
        rv.conflicts = wiggle_isolate_conflicts(af, bf, cf, csl1, csl2, words,
-                                        rv.merger, show_wiggles, &rv.wiggles);
+                                               rv.merger, show_wiggles, &rv.wiggles);
        return rv;
 }
 
@@ -638,8 +638,8 @@ static const char *conflict_types[] = {
        "", " border"," conflict"," wiggle" };
 
 int wiggle_print_merge(FILE *out, struct file *a, struct file *b, struct file *c,
-               int words, struct merge *merger,
-               struct merge *mpos, int streampos, int offsetpos)
+                      int words, struct merge *merger,
+                      struct merge *mpos, int streampos, int offsetpos)
 {
        struct merge *m;
        int lineno = 1;
@@ -786,9 +786,9 @@ int wiggle_print_merge(FILE *out, struct file *a, struct file *b, struct file *c
                                                /* Nothing more to report */
                                                break;
                                        if (cm->in_conflict == 1 &&
-                                              (cm->type == Extraneous ||
-                                               cm->type == Unmatched ||
-                                               cm->type == Unchanged))
+                                           (cm->type == Extraneous ||
+                                            cm->type == Unmatched ||
+                                            cm->type == Unchanged))
                                                /* border between conflicts, but
                                                 * still nothing to report.
                                                 */
index 5bd8f52ff958ed746f51a85f2899aeee05724596..23ba128c4187d42e74737db103b9f82de209ab0e 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -2625,7 +2625,7 @@ static int save_one(FILE *f, struct plist *pl, int reverse,
        struct ci ci;
        int chunks;
        sp = wiggle_load_segment(f, pl->start,
-                         pl->end);
+                                pl->end);
        if (reverse)
                chunks = wiggle_split_patch(sp, &sa, &sb);
        else
@@ -3155,7 +3155,7 @@ int vpatch(int argc, char *argv[], int patch, int strip,
                }
                pl = wiggle_sort_patches(pl, &num_patches);
                main_window(pl, num_patches, in, reverse, replace, ignore_blanks,
-                           just_diff, backup);
+                           just_diff, backup);
                wiggle_plist_free(pl, num_patches);
                fclose(in);
                break;
@@ -3175,10 +3175,10 @@ int vpatch(int argc, char *argv[], int patch, int strip,
                        }
                        pl = wiggle_sort_patches(pl, &num_patches);
                        main_window(pl, num_patches, f, reverse, replace,
-                                   ignore_blanks, just_diff, backup);
+                                   ignore_blanks, just_diff, backup);
                        wiggle_plist_free(pl, num_patches);
                } else if (strlen(argv[0]) > 4 &&
-                        strcmp(argv[0]+strlen(argv[0])-4, ".rej") == 0) {
+                          strcmp(argv[0]+strlen(argv[0])-4, ".rej") == 0) {
                        char *origname = strdup(argv[0]);
                        origname[strlen(origname) - 4] = '\0';
                        show_merge(origname, f, reverse, 0, NULL, NULL,
index c529486de907e0419ba533315c972aa3fc524ee3..712e7fe4bbe0ee3b062fc9b0ed14a99b7c1d8daa 100644 (file)
--- a/wiggle.c
+++ b/wiggle.c
@@ -161,7 +161,7 @@ static int do_diff_lines(struct file fl[2], struct csl *csl)
                        if (fl[0].list[a].start[0]) {
                                printf("-");
                                wiggle_printword(stdout,
-                                         fl[0].list[a]);
+                                                fl[0].list[a]);
                        }
                        a++;
                        exit_status = 1;
@@ -169,7 +169,7 @@ static int do_diff_lines(struct file fl[2], struct csl *csl)
                        if (fl[1].list[b].start[0]) {
                                printf("+");
                                wiggle_printword(stdout,
-                                         fl[1].list[b]);
+                                                fl[1].list[b]);
                        }
                        b++;
                        exit_status = 1;
@@ -180,7 +180,7 @@ static int do_diff_lines(struct file fl[2], struct csl *csl)
                        else {
                                printf(" ");
                                wiggle_printword(stdout,
-                                         fl[0].list[a]);
+                                                fl[0].list[a]);
                        }
                        a++;
                        b++;
@@ -358,11 +358,11 @@ static int do_diff(int argc, char *argv[], int obj, int ispatch,
                        if (which == '2')
                                chunks2 = chunks3 =
                                        wiggle_split_patch(f, &flist[2],
-                                                   &flist[1]);
+                                                          &flist[1]);
                        else
                                chunks2 = chunks3 =
                                        wiggle_split_patch(f, &flist[1],
-                                                   &flist[2]);
+                                                          &flist[2]);
 
                } else
                        flist[1] = wiggle_load_file(argv[1]);
index 2757e7a1721af5b67d4250b225d85b85f0e78b9c..fa588ed8972eb90ec86ce21f8a727ec1f9225e96 100644 (file)
--- a/wiggle.h
+++ b/wiggle.h
@@ -145,18 +145,18 @@ extern struct plist *wiggle_sort_patches(struct plist *pl, int *np);
 extern void wiggle_plist_free(struct plist *pl, int num);
 extern struct plist *wiggle_parse_patch(FILE *f, FILE *of, int *np);
 extern struct stream wiggle_load_segment(FILE *f, unsigned int start,
-                                 unsigned int end);
+                                        unsigned int end);
 extern int wiggle_set_prefix(struct plist *pl, int n, int strip);
 extern struct stream wiggle_load_file(char *name);
 extern int wiggle_split_patch(struct stream, struct stream*, struct stream*);
 extern int wiggle_split_merge(struct stream, struct stream*, struct stream*,
-                      struct stream*);
+                             struct stream*);
 extern struct file wiggle_split_stream(struct stream s, int type);
 extern struct csl *wiggle_pdiff(struct file a, struct file b, int chunks);
 extern struct csl *wiggle_diff(struct file a, struct file b, int shortest);
 extern struct csl *wiggle_diff_patch(struct file a, struct file b, int shortest);
 extern struct csl *wiggle_diff_partial(struct file a, struct file b,
-                               int alo, int ahi, int blo, int bhi);
+                                      int alo, int ahi, int blo, int bhi);
 extern struct csl *worddiff(struct stream f1, struct stream f2,
                            struct file *fl1p, struct file *fl2p);
 extern struct csl *wiggle_csl_join(struct csl *c1, struct csl *c2);